<?php

namespace App\Http\Requests\Api\User;

use App\Http\Requests\Api\BaseRequest;
use Illuminate\Validation\Rule;

class UpdateRequest extends BaseRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'nick_name'=>'required|max:20',
            'age'=>'required|min:1|max:120',
            'sex'=>[
                'required',
                Rule::in(['1','0'])
            ],
        ];
    }

	public function attributes()
    {
		return [
			'nick_name'=>'昵称',
			'age'=>'年龄',
			'sex'=>'性别',
		];
    }

    public function messages()
    {
        return [
          'sex.in'=>'性别不在可选范围内'
        ];
    }
}
